import request from '@/utils/request'

// 查询指令列表
export function listCommand(query) {
  return request({
    url: '/ips/command/list',
    method: 'get',
    params: query
  })
}

// 频道切换
export function listChannelCut(query) {
  return request({
    url: '/ips/command/ChannelCut',
    method: 'get',
    params: query
  })
}

// 查询指令详细
export function getCommand(id) {
  return request({
    url: '/ips/command/' + id,
    method: 'get'
  })
}

// 新增指令
export function addCommand(data) {
  return request({
    url: '/ips/command/save',
    method: 'post',
    data: data
  })
}

// 修改指令
export function editCommand(data) {
  return request({
    url: '/ips/command/update',
    method: 'put',
    data: data
  })
}

// 删除指令
export function delCommand(id) {
  return request({
    url: '/ips/command/remove/' + id,
    method: 'delete'
  })
}

// 导出指令
export function exportCommand(query) {
  return request({
    url: '/ips/command/export',
    method: 'get',
    params: query
  })
}

export function uploadCover(data) {
  return request({
    headers: {
      'Accept': '*/*',
      'Content-Type': 'multipart/form-data'
    },
    // url: '/common/upload',
    url: '/ips/program/updateCover',
    method: 'put',
    data
  })
}
